import router from '@/router'
import {getToken,setpre} from '@/until/auth'

const whitelist = [ '/','/home','/anniu1','/anniu3','/login','/enroll','/article']
router.beforeEach((to,from,next)=>{
    if(getToken()){
        next()
    }else{
        if(whitelist.indexOf(to.path) >= 0){
            next()
        }else{
            setpre(to.path)
            next('/enroll')
        }
    }
})

